import { useState } from "react"
import { Popover, PopoverTrigger, PopoverContent } from "../ui/popover"

interface ActionMenuProps {
  children: React.ReactNode
}

export const ActionMenuADvanced = ({ children }: ActionMenuProps) => {
  const [showActionMenu, setShowActionMenu] = useState(false);

  return <Popover open={showActionMenu} onOpenChange={setShowActionMenu}>
    {children}
  </Popover>
}

ActionMenuADvanced.Button = ({ children }: ActionMenuProps) => <PopoverTrigger asChild >{children}</PopoverTrigger>
ActionMenuADvanced.Content = ({ children }: ActionMenuProps) => <PopoverContent className="z-[99] w-max p-1" side='right' align="start" >{children}</PopoverContent>